/*
 * @(#)GetUnpayedListRequestBean.java 创建于 2016-07-14 14:54:50
 *
 * 版权：版权所有 Bsoft 保留所有权力。
 */
package hcn.protocol.ods.diagnosis;

import ctd.util.xml.jaxb.DateAdapter;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author <a href="mailto:chinnsii@163.com">zhengshi</a>
 */
@XmlRootElement(name = "getUnpayedListRequest")
public class GetUnpayListRequestBean implements Serializable {

    private String orgId;
    private Date beginDate;
    private Date endDate;
    private List<CertificateBean> certificates;
    private List<CardBean> cards;

    public String getOrgId() {
        return orgId;
    }

    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }

    @XmlJavaTypeAdapter(DateAdapter.class)
    public Date getBeginDate() {
        return beginDate;
    }

    public void setBeginDate(Date beginDate) {
        this.beginDate = beginDate;
    }

    @XmlJavaTypeAdapter(DateAdapter.class)
    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    @XmlElementWrapper(name = "certificates")
    @XmlElement(name = "certificate")
    public List<CertificateBean> getCertificates() {
        return certificates;
    }

    public void setCertificates(List<CertificateBean> certificates) {
        this.certificates = certificates;
    }

    public void addCertificate(CertificateBean certificateBean) {
        if (certificates == null) {
            certificates = new ArrayList<CertificateBean>();
        }
        this.certificates.add(certificateBean);
    }

    @XmlElementWrapper(name = "cards")
    @XmlElement(name = "card")
    public List<CardBean> getCards() {
        return cards;
    }

    public void setCards(List<CardBean> cards) {
        this.cards = cards;
    }

    public void addCard(CardBean card) {
        if (cards == null) {
            cards = new ArrayList<>();
        }
        this.cards.add(card);
    }
}
